<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
    <title>快乐购1号店(周博)</title>
    <link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/head.css"/>
    <link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/footer.css"/>
   

    <!-- 自定义样式 -->
    
		<link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/go.css"/>
		<link rel="stylesheet" type="text/css" href="/Application/Home/Common/css/2.css"/>

		

<script src="/Application/Home/Common/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
 <script type="text/javascript" charset="utf-8" src="/Application/Home/Common/js/jquery.countdown.js"></script>

<script type="text/javascript" charset="utf-8" src="/Public/utf8-php/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Public/utf8-php/ueditor.all.min.js"> </script>
     <script type="text/javascript" charset="utf-8" src="/Public/utf8-php/lang/zh-cn/zh-cn.js"></script>


  <?php echo hook('pageHeader');?>
</head>
<body>
	<!-- 头部 -->
	<div class="header">
    <!--顶部导航-->
      <div class="header_top">
        <div class="w1200">
          <div class="h_t_l">
        <?php if(is_login()): ?><div class="login_l">
                <span>
                欢迎<b class="caret"><?php echo get_username();?></b>来到快乐购!</span>
                    <a class="a_login" href="<?php echo U('User/profile');?>">[修改密码]</a>
                <span class="line"></span>
                <a class="" href="<?php echo U('User/logout');?>">[退出]</a>
            </div>
            <?php else: ?>
                <a class="a_login" href="<?php echo U('User/login');?>">[登录]</a>
                <span class="line"></span>
                <a class="" href="<?php echo U('User/register');?>">[注册]</a><?php endif; ?>
          </div>
          <div class="h_t_r">
            <ul>
              <li>
                <a href="">订单查询</a>
                <span class="line"></span>
              </li>
              <li>
                <a href="">我的快乐购</a>
                <span class="line"></span>
              </li>
              <li>
                <i class="tel_icon"></i>
                <a href="">400-705-1111</a>
                <span class="line"></span>
              </li>
              <li>
                <a href="">下载快乐购app</a>
                <div class="down_load">
                                    <div class="down_border">
                                        <b class="icon_top"></b>
                                        <img style="" src="/Application/Home/Common/image/down_load_20160411.png">
                                        <p>快乐生活 快乐购</p>
                                    </div>
                                </div>
                <span class="line"></span>
              </li>
              <li class="cus_c_box">
                <a href="">客服中心</a>
                <div class="cus_center">
                                    <a href="">帮助中心</a>
                                    <a href="">会员反馈</a>
                                </div>
              </li>
            </ul>
          </div>
        </div>
      </div>
        <!--搜索-->
        
	<!-- /头部 -->
	
	<!-- 主体 -->
	

<div id="" class="">

        
           
        
        
			<!--图片-->
			<div class="full_sc order_bottom">
				<div class="w1200 header_conter ">
					<div class="h_c_logo">
	    			    <a href="index.html">
	    				    <img src="/Application/Home/Common/image/logo.jpg"/>
	    			    </a>
	    		    </div>
	    		    <div class="h_c_right">
	    		    	<div class="order_Status"></div>
	    		    </div>
				</div>
			</div>
			<!--end-->
		</div>
		<!--tip-->
		<div class="public_b">
			<div class="w1200">
				<div id="main">
					<div class="w930 m0a mt30">
						<div class="ml20">
							<b class="f16">购物车：</b>
							<?php if(is_login()): ?><a id="login_now" href="<?php echo U('Index/index');?>" class="cd00 ul fancybox.iframe">回到首页</a>
							<?php else: ?>
							  
							  <a id="login_now" href="<?php echo U('User/login');?>" class="cd00 ul fancybox.iframe">现在登录</a>
                            
							<span class="c999">购物车信息将一直为您保存</span><?php endif; ?>
						</div>
						
						<div class="bgf6f br10">
							<ul class="c999 f13 h40 mt10 li_left">
								<!-- <li class="row-selected row-selected"><input class="check-all" type="checkbox"/></li> -->                    
								<li class="w510 tl pl20">商品</li>
								<li class="">属性</li>
								<li class="w120 tc" style="margin-left: 45px">售价</li>
								<li class="w120 tc">数量</li>
								<li class="w80 tr pr64" >操作<input class="check-all checkbox_all" type="checkbox"></li>
							</ul>
                             <input type="hidden" name="id" value="<?php echo ($vo["id"]); ?>">

                           <form action="<?php echo U('Car/submitpath');?>" method="post">
							<ul class="bt_1_eae bb_1_fff" id="goods_line_548546"></ul>
							<?php if(is_array($car)): $i = 0; $__LIST__ = $car;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><ul class="999 f13 h120 li_left" id="goods_list_548546">
								<li class="w510 tl pl20">
									<a href="<?php echo U('Index/iemt',array('gid'=>$vo['gid']));?>" target="_blank" class="fl">
										<img src="/Uploads/<?php echo ($vo["pic"]); ?>" width="100px" height="100px" class="m_10_20_10_0" alt="">
									</a>
									<a href="<?php echo U('Index/iemt',array('gid'=>$vo['gid']));?>" target="_blank">
									   
										<span class="bold c333 fl h20 mt35"><?php echo ($vo["name"]); ?></span>
									</a>
								</li>
								<li class="w120 ">
									<span class="bold ccf0 f16"><?php echo ($vo["attrvid"]); ?></span>
								</li>
								<li class="w120 mprice">
									<span class="bold ccf0 f16 danjia" id="mprice"><?php echo ($vo["mprice"]); ?></span>
								</li>
								<li class="w120 num">
									<span class="lose" style="border: 1px solid white;">-</span>                   
									<input type="text" id="goods" name="goods_number" maxlength="4" size="2" value="<?php echo ($vo["num"]); ?>" class="b_1_e5e p_0_5 tc w28 h20 ie-t1_m50 ie_mi goods_number c000 bold" oprid="548546" oprnum="1">
									<span class="aaa" style="border: 1px solid white;">+</span>
								</li>




								<li class="w100 tr">
									<a href="" id="collection" oprid="25523" class="ul">收藏</a>
									<a href="<?php echo U('Car/delete',array('id'=>$vo['id']));?>" data="548546" class="ul delete">删除</a>
									
									<input class="ids checkbox_child" type="checkbox" name="id[]" value="<?php echo ($vo["id"]); ?>">
								</li>               </ul><?php endforeach; endif; else: echo "" ;endif; ?>

							<ul class="bt_1_eae bb_1_fff"></ul>


							<!-- Cale 2014-03-13-->



							<div class="clear"></div>
						</div>
						
						<div class="w930 m0a">
							<div class="fl">
								<div class="mt50">
									<a href="/index.php/Home/Index/index.html" class="f14 bold c999 b_1_efe btnf7f w146 h40 fl tc">继续购物</a>
								</div>
							</div>
							<div class="fr">
								<div class="tc cd00 mt20">
									<span class="f13 bold">商品总额：￥</span>
									<span class="f20 jianqiangzong" id="goods_amount">0</span>
								</div>

								<div class="mt20 tr">
									<input  type="submit" class="btnd00 w146 h40 f16 bold "  value="去结算">
								</div>

							</div>
						</div>
						</form>
    </div>
</div>
				<!--为你推荐-->
				<div class="guesslike_div">
					<div class="remat">
						<div class="d_h2">
							<ul>
                                <li class="on">猜你喜欢</li>
                            </ul>
						</div>
						<div class="detail_l_con4">
							<div class="noguess">暂无商品向您推荐</div>
						</div>
					</div>
				</div>
				<!--为你推荐-->
			</div>
		</div>
		
   
       
</div>



<script type="text/javascript">
    $(function(){
        $(window).resize(function(){
            $("#main-container").css("min-height", $(window).height() - 343);
        }).resize();
    })
</script>
	<!-- /主体 -->

	<!-- 底部 -->
	<div class="footer">
        <div class="footer_b w1200"><img src="/Application/Home/Common/image/foot_img1.jpg"/></div>
        <div class="footer_help w1200">
          <div class="footer1_l">
            <dl class="helpDl">
              <dt><h5>使用帮助</h5></dt>
              <dd><a href="">税费收取规则 </a></dd>
              <dd><a href="">新手指南 </a></dd>
                <dd><a href="">常见问题 </a></dd>
              <dd><a href="">用户协议 </a></dd>
            </dl>
            <dl class="helpDl">
              <dt><h5>会员服务</h5></dt>
              <dd><a href="">积分政策  </a></dd>
              <dd><a href="">会员权益  </a></dd>
                <dd><a href="">会员等级  </a></dd>
            </dl>
            <dl class="helpDl">
              <dt><h5>支付方式</h5></dt>
              <dd><a href="">积分支付  </a></dd>
              <dd><a href="">货到付款  </a></dd>
                <dd><a href="">在线支付  </a></dd>
              <dd><a href="">优惠券支付  </a></dd>
            </dl>
            <dl class="helpDl">
              <dt><h5>配送方式</h5></dt>
              <dd><a href="">包邮政策   </a></dd>
              <dd><a href="">费用说明   </a></dd>
                <dd><a href="">配送说明   </a></dd>
            </dl>
            <dl class="helpDl">
              <dt><h5>售后服务</h5></dt>
              <dd><a href="">电子发票   </a></dd>
              <dd><a href="">售后咨询   </a></dd>
                <dd><a href="">退货办理   </a></dd>
              <dd><a href="">退货政策   </a></dd>
            </dl>
          </div>
          <div class="footer1_r">
            <ul>
              <li>
                <h2>手机快乐购</h2>
                <img src="/Application/Home/Common/image/footer_ewm_01.png"/>
                <p>下载移动客户端</p>
              </li>
              <li>
                <h2>快乐购微信</h2>
                <img src="/Application/Home/Common/image/footer_ewm_02.png"/>
                            <p>快乐购官方微信</p>
              </li>
            </ul>
          </div>
        </div>
          <div class="footer_nav">
            <div class="w720">
              <ul>
                <li>
                  <a href="">关于快乐购 </a>
                  <span class="line"></span>
                </li>
                <li>
                  <a href="">投资者关系 </a>
                  <span class="line"></span>
                </li>
                <li>
                  <a href="">商家入驻  </a>
                  <span class="line"></span>
                </li>
                <li>
                  <a href="">联系我们 </a>
                  <span class="line"></span>
                </li>
              </ul>
            </div>
          </div>
          <div class="footer_bottom">
            <div class="w1200">
              <p>
                <span class="font_arial">Copyright© 2006-2016 happigo. All Rights Reserved </span>
                                           免费服务热线: 400-705-1111 | 固话也可拨打: 800-705-1111
                        <span class="font_arial">E-Mail: service@happigo.com</span><br>
                                           湘ICP备12000157号 信息网络传播视听节目许可证号：1810530
              </p>
              <p class="footer_b">
                <a href="http://www.itrust.org.cn/home/index/itrust_certifi/wm/2782875193.html">
                  <img src="/Application/Home/Common/image/foot_img3.png"/>
                </a>
                <a href="https://search.szfw.org/cert/l/CX20150428007576007720">
                  <img src="/Application/Home/Common/image/foot_img4.png"/>
                </a>
              </p>
            </div>
          </div>
      </div>


    <script type="text/javascript">
(function(){
	var ThinkPHP = window.Think = {
		"ROOT"   : "", //当前网站地址
		"APP"    : "", //当前项目地址
		"PUBLIC" : "/Public", //项目公共目录地址
		"DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
		"MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
		"VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
	}
})();
</script>
  

<script type="text/javascript" src="/Public/static/jquery-2.0.3.min.js"></script>
<script type="text/javascript">
    $(function(){
      $('li span.aaa').click(function(){
        var index = $('li span.aaa').index($(this));
        // alert(index); 
            var x=$('input[id=goods]').eq(index).val();
            var id=$('input[name=id]').eq(index).val();
             //alert(id);
                x++;
            var r = /^[0-9]*[1-9][0-9]*$/;
                if(!r.test(x)){
                    x=Math.ceil(x);
                }
                var c =$('li span#mprice').index($(this));

                var count=Number($('#goods_amount').html());
                var price=Number($('li span#mprice').eq(c).html());
                 
                $('#goods_amount').html(count+price);


                $('input[id=goods]').eq(index).val(x);
            $.post("<?php echo U('Car/update');?>", { x: x ,id:id},
                    function(data){
                         
                    });
               
        });

      $('li span.lose').click(function(){
        var index = $('li span.lose').index($(this));
        var id=$('input[name=id]').eq(index).val();
         //alert(id);

            var x=$('input[id=goods]').eq(index).val();
                x--;
            var r = /^[0-9]*[1-9][0-9]*$/;
                if(x<1){
                    x=1
                }
                if(!r.test(x)){
                    x=Math.ceil(x);
                }
                var c =$('li span#mprice').index($(this));

                var count=Number($('#goods_amount').html());
                var price=Number($('li span#mprice').eq(c).html());
                if (x!=1) {
                $('#goods_amount').html(count-price);
                  }
                $('input[id=goods]').eq(index).val(x);
            $.post("<?php echo U('Car/update');?>", { x: x,id:id },
                    function(data){
                         
                    });

        });

                


        //  $('.check-all').click(function(){
        //      $("input[type=checkbox]").attr("checked","true");
        // });

        // $(".check-all").click(function(){
            
        //     $("input[type='checkbox']").attr("checked",this.checked);
        //     });
  
        //     $("input[type='checkbox']").click(function(){
        //         var flag=true;
                
        //     $("input[type='checkbox']").each(function(){
        //         if(!this.checked){
        //             flag=false;
        //             // alert(flag);
        //         }
        //     });
        //         $(".check-all").attr("checked",flag);
        //     })

            var unitprice_zong = 0; //总价
			var childL = 0; //个数
			var zonggong=0;
            
			$(".checkbox_child").click(function(){
			    var index = $(".checkbox_child").index($(this));
				var num = $("input[name=goods_number]").eq(index).val();
				var price = $(".danjia").eq(index).text();
				var total = num*price;
				if($(this).is(":checked")){
					zonggong+=total;
				}else{
					zonggong-=total;
				}
				// console.log(zonggong);
                $('.settlement_a').css('background', 'red');
				$("#goods_amount").html(zonggong);
			})

			$('.checkbox_all').click(function(){
				if ($(this).is(":checked")) {
				// 全选
				$('.checkbox_child').prop("checked", true);
				// 全选改变结算背景色
				$('.settlement_a').css('background', 'red');
				// $('.checkbox_child').each(function() {
				
				var i = $(".checkbox_all").index($(this));
				var num = $("input[name=goods_number]").eq(i).val();
				var price = $(".danjia").eq(i).text();
				// var total += num*price;
				   console.log(i);
				// });
				$("#goods_amount").html(zonggong);

			} else {
			// 全不选
			$('.checkbox_child').prop("checked", false);
			// 按钮变色
			$('.settlement_a').css('background', 'rgba(232,170,59,1)');
			// 总个数
			// childL = 0;
			// $('.number_geshu').text(childL);
			// 计算总价
			unitprice_zong = 0;
			$('.jianqiangzong').text(unitprice_zong);
		}
	});



    });
</script>
 <!-- 用于加载js代码 -->
<!-- 页面footer钩子，一般用于加载插件JS文件和JS代码 -->
<?php echo hook('pageFooter', 'widget');?>
<div class="hidden"><!-- 用于加载统计代码等隐藏元素 -->
  
</div>
	<!-- /底部 -->
</body>
</html>